
using UnityEngine;
using UnityEngine.SceneManagement;

public class BeginPanel : BasePanel<BeginPanel>
{
    public CustomGUIButton btnBegin;
    public CustomGUIButton btnSetting;
    public CustomGUIButton btnExit;
    public CustomGUIButton btnRank;
    void Start()
    {
        Cursor.lockState = CursorLockMode.Confined;//光标限制
        btnBegin.clickEvent += () =>
        {
            //加载游戏场景
            SceneManager.LoadScene("GameScene");
        };
        btnSetting.clickEvent += () =>
        {
            //打开设置面板
            SettingPanel.Instance.ShowMe();
            //隐藏自己
            HideMe();
        };
        btnExit.clickEvent += () =>
        {
            //退出游戏
            Application.Quit();
        };
        btnRank.clickEvent += () =>
        {
            //打开排行榜面板
            RankPanel.Instance.ShowMe();
            //隐藏自己
            HideMe();
        };
    }

}
